﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SocialFront
{
    public class StringFunctions
    {
        /// <summary>
        /// Removes the unsafe characters.
        /// </summary>
        /// <param name="input">The input.</param>
        /// <returns></returns>
        public string RemoveUnsafeCharacters(string input)
        {
            string output = "";
            input = input.Replace(' ', '-');
            output = System.Text.RegularExpressions.Regex.Replace(input, @"[^\w\.-]", "");
            output = System.Text.RegularExpressions.Regex.Replace(output, @"[-]+", "-");
            return output;
        }
    }
}
